<?php
require_once __DIR__ . '/vendor/autoload.php';

use PhpAmqpLib\Message\AMQPMessage;
use PhpAmqpLib\Connection\AMQPStreamConnection;

$connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest', '/');
$channel = $connection->channel();
$channel->queue_declare('job', false, false, false, false);

$msg = new AMQPMessage('DreamPHP!');

$channel->basic_publish($msg, '', 'job');

echo "Send Success!\n";
$channel->close();
$connection->close();
